package controller.roomManagement.Implementation;

import view.RoomManageView;
import model.roomManagement.Interface.IRoomManageModel;
import controller.roomManagement.Interface.IRoomManageController;


public class RoomManageController implements IRoomManageController {

	IRoomManageModel RMM;
	RoomManageView RMV;
	public RoomManageController(IRoomManageModel RMM){
		this.RMM=RMM;
	//   RMV=new RoomManageView(this,RMM);
		
	}
	
	
	@Override
	public int creatRoom(String subject,String password) {
		
		return RMM.creatRoom(subject, password);
	}

	@Override
	public boolean deletRoom(int roomId) {
		return RMM.deletRoom(roomId);
		
	}

	@Override
	public boolean enter(int roomId) {
		
		return RMM.enter(roomId);
	}

	@Override
	public boolean exit() {
		return RMM.exit();
		
	}

	@Override
	public boolean join(int roomId,String password) {
		return RMM.join(roomId,password);
		
	}

	@Override
	public boolean quit(int roomId) {
		return RMM.quit(roomId);
		
	}


	@Override
	public void quitTheSystem() {
		RMM.quitTheSystem();
		
	}


	public String getRoomInfoByRId(int roomId) {
		
		return RMM.getRoomInfoByRId(roomId);
	}


	@Override
	public boolean changePassWord(String oldPassword, String newPassword) {
		// TODO Auto-generated method stub
		return RMM.changePassWord(oldPassword,newPassword);
	}




}
